package org.brownflat.lighthouse.web;

import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.integration.spring.SpringBean;
import org.brownflat.lighthouse.monitoring.ci.Build;
import org.brownflat.lighthouse.monitoring.monitor.MonitoringService;

import java.util.List;

/**
 * &copy; Rupert Jones 2011
 */
public class StatusAction extends AbstractAction {

    @SpringBean
    private MonitoringService monitoringService;

    @DefaultHandler
    public Resolution view() {
        return getForwardJSPResolution("status.jsp");
    }

    public List<Build> getLatestBuilds() {
        return monitoringService.getLatestBuilds();
    }
}
